<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
    <head>
      	<meta charset="utf-8"/> 
        <title>Hello World! sec:authentication="name"</title>
        <link th:href="@{css/bootstrap.min.css}"  rel="stylesheet" />
      <style type="text/css">
     body{
     padding-top:50px;
     }
     .starter-template{
     padding:40px 15px;
     text-align:center;
     }
    </style>
    
    </head>
    <body>
     <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
	    <div class="navbar-header">
	     <a class="navbar-brand" href="#">welcome</a>
	    </div>
	     <div id="navbar" class="collapse navbar-collapse">
		     <ul class="nav navbar-nav">
		     <li><a th:href="@{/}">首页</a></li>
		     </ul>
	     </div>
	    </div>
    </nav>
         <div class="container">   
       <div class="starter-template">  
       <h1 th:text="${msg.title}"></h1>
       <p class="bg_primary" th:text="${msg.content}"></p>
       
        <div sec:authorize="hasRole('ROLE_ADMIN')">
		<p class="bg-info"    th:text="${msg.etraInfo}"></p>
        </div>
         <div sec:authorize="hasRole('ROLE_USER')">
		<p class="bg-info"    th:text="${msg.etraInfo}"></p>
        </div>
        <div th:if="${param.logout}" class="bg_danger">
        <p class="bg-info" > 无更多信息显示</p>
        </div>
        <form name="form" th:action="@{/loginout}"  method="post">
           <input type="submit" value="注销" class="btn btn-primary" />
        </form>
          </div>
	    </div>
    </body>
</html>